package com.nari.ncps.screen.controller;

import com.nari.ncps.screen.common.pojo.ApiResponse;
import com.nari.ncps.screen.service.coal.CoalProdoperOutputService;
import com.nari.ncps.screen.service.coal.CoalProdoperSalesService;
import com.nari.ncps.screen.service.coal.CoalProdoperStockService;
import com.nari.ncps.screen.service.dryport.DryportProdoperGoodsSendService;
import com.nari.ncps.screen.service.dryport.DryportProdoperPortGatherService;
import com.nari.ncps.screen.service.dryport.DryportProdoperTurnoverService;
import com.nari.ncps.screen.service.electric.ElectricProdoperFuelService;
import com.nari.ncps.screen.service.electric.ElectricProdoperPowerGeneralService;
import com.nari.ncps.screen.service.wholeproduct.*;
import com.nari.ncps.screen.vo.coal.CoalOutputVO;
import com.nari.ncps.screen.vo.wholeproduct.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 能源消费表 前端控制器
 * </p>
 *
 * @author xuesong
 * @since 2025-08-23
 */
@Tag(name = "全产业一体化", description = "全产业一体化")
@RestController
@RequestMapping("/wholeproduct")
public class WholeProductController {

    @Resource
    private CoalProdoperOutputService coalProdoperOutputService;
    @Resource
    private CoalProdoperSalesService coalProdoperSalesService;
    @Resource
    private CoalProdoperStockService coalProdoperStockService;
    @Resource
    private DryportProdoperGoodsSendService dryportProdoperGoodsSendService;
    @Resource
    private DryportProdoperTurnoverService dryportProdoperTurnoverService;
    @Resource
    private DryportProdoperPortGatherService dryportProdoperPortGatherService;
    @Resource
    private ElectricProdoperPowerGeneralService electricProdoperPowerGeneralService;
    @Resource
    private ElectricProdoperFuelService electricProdoperFuelService;
    @Resource
    private IWholeNeInstallVolumeService wholeNeInstallVolumeService;
    @Resource
    private IWholeNeRealTimePowerService wholeNeRealTimePowerService;
    @Resource
    private IWholeNePowerGenerationService wholeNePowerGenerationService;
    @Resource
    private IWholeAlProductionService wholeAlProductionService;
    @Resource
    private IWholeAlSalesService wholeAlSalesService;
    @Resource
    private WholeOverviewItemService wholeOverviewItemService;
    @Resource
    private IWholeNeProdEfficService wholeNeProdEfficService;


    //直接调用煤炭板块的 11月03日修改
    @Operation(summary = "煤炭-煤炭产量完成情况-计划原煤产量", description = "煤炭-煤炭产量完成情况-计划原煤产量")
    @GetMapping(value = "/coalOutputCompletion")
    public ApiResponse<CoalOutputVO> coalOutputCompletion(@RequestParam(value = "year", required = false) Integer year) {
        /*
          直接调用煤炭板块的 11月03日修改
         */
        CoalOutputVO vo = coalProdoperOutputService.getCoalOutput(year);
        return ApiResponse.succeed(vo);
    }

    //直接调用煤炭板块的 11月03日修改
    @Operation(summary = "煤炭-煤炭产量完成情况-实际原煤产量及原煤产量完成率",
                                                    description = "煤炭-煤炭产量完成情况-实际原煤产量及原煤产量完成率")
    @GetMapping(value = "/monthlyOutputCompletion")
    public ApiResponse<List<MonthlyOutputCompletionVO>> monthlyOutputCompletion(@RequestParam(value = "year", required = false) Integer year) {

        List<MonthlyOutputCompletionVO> list1=coalProdoperOutputService.getMonthlyOutputCompletion(year);
         return ApiResponse.succeed(list1);
    }




   //1104修改 zys
    @Operation(summary = "煤炭-本年度商品煤销量完成情况-煤炭计划销量", description = "煤炭-本年度商品煤销量完成情况-煤炭计划销量")
    @GetMapping(value = "/annualSalesCompletion")
    public ApiResponse<AnnualSalesCompletionVO> annualSalesCompletion(@RequestParam(value = "year", required = false) Integer year) {
       AnnualSalesCompletionVO vo = coalProdoperSalesService.getAnnualSalesCompletion(year);
      //  AnnualSalesCompletionVO vo = new AnnualSalesCompletionVO();

//        vo.setAnnualPlan(new BigDecimal("7900"));
//        vo.setAnnualActual(new BigDecimal("5774"));
//        vo.setAnnualCompletionRate(new BigDecimal("73"));
        return ApiResponse.succeed(vo);
    }




    @Operation(summary = "煤炭-本年度商品煤销量完成情况-煤炭实际销量", description = "煤炭-本年度商品煤销量完成情况-煤炭实际销量")
    @GetMapping(value = "/annualActualSales")
    public ApiResponse<List<AnnualActualSalesVO>> annualActualSales(@RequestParam(value = "year", required = false) Integer year) {
//        List<AnnualActualSalesVO> list = coalProdoperSalesService.getAnnualActualSales(year);
        List<AnnualActualSalesVO> list = coalProdoperSalesService.getAnnualActualSales(year);


//        List<AnnualActualSalesVO> list = new ArrayList<>();
//
//        list.add(new AnnualActualSalesVO() {{
//            setYear(2021);
//            setAnnualActual(new BigDecimal("7427"));
//        }});
//
//        list.add(new AnnualActualSalesVO() {{
//            setYear(2022);
//            setAnnualActual(new BigDecimal("7604"));
//        }});
//
//        list.add(new AnnualActualSalesVO() {{
//            setYear(2023);
//            setAnnualActual(new BigDecimal("7797"));
//        }});
//
//        list.add(new AnnualActualSalesVO() {{
//            setYear(2024);
//            setAnnualActual(new BigDecimal("7878"));
//        }});
//
//        list.add(new AnnualActualSalesVO() {{
//            setYear(2025);
//            setAnnualActual(new BigDecimal("5774"));
//        }});

        return ApiResponse.succeed(list);
    }

    @Operation(summary = "煤炭-本年度商品煤销量完成情况-煤炭销量完成率", description = "煤炭-本年度商品煤销量完成情况-煤炭销量完成率")
    @GetMapping(value = "/annualSalesCompletionRate")
    public ApiResponse<List<AnnualSalesCompletionRateVO>> annualSalesCompletionRate(@RequestParam(value = "year", required = false) Integer year) {
        List<AnnualSalesCompletionRateVO> list = coalProdoperSalesService.getAnnualSalesCompletionRate(year);
//        List<AnnualSalesCompletionRateVO> list = new ArrayList<>();

//        List<AnnualSalesCompletionRateVO> list = new ArrayList<>();

//        list.add(new AnnualSalesCompletionRateVO() {{
//            setYear(2022);
//            setAnnualCompletionRate(new BigDecimal("100.06"));
//        }});
//
//        list.add(new AnnualSalesCompletionRateVO() {{
//            setYear(2023);
//            setAnnualCompletionRate(new BigDecimal("100.05"));
//        }});
//
//        list.add(new AnnualSalesCompletionRateVO() {{
//            setYear(2024);
//            setAnnualCompletionRate(new BigDecimal("99.73"));
//        }});
//
//        list.add(new AnnualSalesCompletionRateVO() {{
//            setYear(2025);
//            setAnnualCompletionRate(new BigDecimal("73"));
//        }});

        return ApiResponse.succeed(list);
    }

    @Operation(summary = "煤炭-煤炭库存量情况-库存量", description = "煤炭-煤炭库存量情况-库存量")
    @GetMapping(value = "/annualStock")
    public ApiResponse<List<AnnualStockVO>> annualStock(@RequestParam(value = "year", required = false) Integer year) {
        List<AnnualStockVO> list = coalProdoperStockService.getAnnualStock(year);



//        List<AnnualStockVO> list = new ArrayList<>();
//
//        list.add(new AnnualStockVO() {{
//            setYear(2021);
//            setCurrentStock(new BigDecimal("44.5"));
//        }});
//
//        list.add(new AnnualStockVO() {{
//            setYear(2022);
//            setCurrentStock(new BigDecimal("47.8"));
//        }});
//
//        list.add(new AnnualStockVO() {{
//            setYear(2023);
//            setCurrentStock(new BigDecimal("67.3"));
//        }});
//
//        list.add(new AnnualStockVO() {{
//            setYear(2024);
//            setCurrentStock(new BigDecimal("88.8"));
//        }});
//
//        list.add(new AnnualStockVO() {{
//            setYear(2025);
//            setCurrentStock(new BigDecimal("50.4"));
//        }});



        return ApiResponse.succeed(list);
    }

    @Operation(summary = "煤炭-煤炭库存量情况-库存量-最新数据", description = "煤炭-煤炭库存量情况-库存量-最新数据")
    @GetMapping(value = "/newestCoalStockDetail")
    public ApiResponse<List<AnnualStockVO>> annualStockNow(@RequestParam(value = "year", required = false) Integer year) {
        List<AnnualStockVO> list = coalProdoperStockService.getAnnualStockNow(year);
        return ApiResponse.succeed(list);
    }

    @Operation(summary = "煤炭-煤炭库存量情况-库存量环比率", description = "煤炭-煤炭库存量情况-库存量环比率")
    @GetMapping(value = "/coalStockDetail")
    public ApiResponse<CoalStockDetailVO> coalStockDetail(@RequestParam(value = "year", required = false) Integer year) {
        CoalStockDetailVO vo = coalProdoperStockService.getCoalStockDetail(year);


//
//        CoalStockDetailVO vo = new CoalStockDetailVO();
//
//// 设置基本数据
//        vo.setCurrentMonthStock(new BigDecimal("50.42"));
//        vo.setLastMonthStock(new BigDecimal("72.47"));
//        vo.setLowHeatRatio(new BigDecimal("40"));
//        vo.setNormalHeatRatio(new BigDecimal("30"));
//        vo.setMediumHeatRatio(new BigDecimal("20"));
//        vo.setHighHeatRatio(new BigDecimal("10"));
//
//// 计算库存量环比
//        BigDecimal currentStock = new BigDecimal("50.42");
//        BigDecimal lastStock = new BigDecimal("72.47");
// 环比 = (本月库存 - 上月库存) / 上月库存 * 100
//        BigDecimal stockMomRate = currentStock.subtract(lastStock)
//                .divide(lastStock, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//        vo.setStockMomRate(stockMomRate);


        return ApiResponse.succeed(vo);
    }

    @Operation(summary = "煤炭-煤炭库存量情况-库存量同比率", description = "煤炭-煤炭库存量情况-库存量同比率")
    @GetMapping(value = "/coalStockYoy")
    public ApiResponse<CoalStockYoyVO> coalStockYoy(@RequestParam(value = "year", required = false) Integer year) {
        CoalStockYoyVO vo = coalProdoperStockService.getCoalStockYoy(year);


//        CoalStockYoyVO vo = new CoalStockYoyVO();
//
//// 设置基本数据
//        vo.setCurrentMonthStock(new BigDecimal("50.42"));
//        vo.setLastYearSamePeriodStock(new BigDecimal("60.6"));
//        vo.setLowHeatRatio(new BigDecimal("35"));
//        vo.setNormalHeatRatio(new BigDecimal("35"));
//        vo.setMediumHeatRatio(new BigDecimal("20"));
//        vo.setHighHeatRatio(new BigDecimal("10"));
//
//// 计算库存量同比
//        BigDecimal currentStock = new BigDecimal("50.42");
//        BigDecimal lastYearStock = new BigDecimal("60.6");
//// 同比 = (本月库存 - 去年同期库存) / 去年同期库存 * 100
//        BigDecimal stockYoyRate = currentStock.subtract(lastYearStock)
//                .divide(lastYearStock, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//        vo.setStockYoyRate(stockYoyRate);



        return ApiResponse.succeed(vo);
    }


    @Operation(summary = "路港-铁路货物发送情况", description = "路港-铁路货物发送情况")
    @GetMapping(value = "/railwayGoodsSend")
    public ApiResponse<List<RailwayGoodsSendVO>> railwayGoodsSend(@RequestParam(value = "year", required = false) Integer year) {
         List<RailwayGoodsSendVO> list = dryportProdoperGoodsSendService.getRailwayGoodsSendAnnual(year);


//
//
//        List<RailwayGoodsSendVO> list = new ArrayList<>();
//
//// 2021年数据（没有同比计算，使用给定的1.06）
//        RailwayGoodsSendVO vo2021 = new RailwayGoodsSendVO();
//        vo2021.setYear(2021);
//        vo2021.setRailwayPlannedVolume(new BigDecimal("2187"));
//        vo2021.setRailwayCompletedVolume(new BigDecimal("2007"));
//        vo2021.setYoyRate(new BigDecimal("1.06"));
//        list.add(vo2021);
//
//// 2022年数据
//        BigDecimal completed2021 = new BigDecimal("2007");
//        BigDecimal completed2022 = new BigDecimal("2258");
//        BigDecimal yoyRate2022 = completed2022.subtract(completed2021)
//                .divide(completed2021, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        RailwayGoodsSendVO vo2022 = new RailwayGoodsSendVO();
//        vo2022.setYear(2022);
//        vo2022.setRailwayPlannedVolume(new BigDecimal("2273"));
//        vo2022.setRailwayCompletedVolume(completed2022);
//        vo2022.setYoyRate(yoyRate2022);
//        list.add(vo2022);
//
//// 2023年数据
//        BigDecimal completed2023 = new BigDecimal("3283");
//        BigDecimal yoyRate2023 = completed2023.subtract(completed2022)
//                .divide(completed2022, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        RailwayGoodsSendVO vo2023 = new RailwayGoodsSendVO();
//        vo2023.setYear(2023);
//        vo2023.setRailwayPlannedVolume(new BigDecimal("3888"));
//        vo2023.setRailwayCompletedVolume(completed2023);
//        vo2023.setYoyRate(yoyRate2023);
//        list.add(vo2023);
//
//// 2024年数据
//        BigDecimal completed2024 = new BigDecimal("3110");
//        BigDecimal yoyRate2024 = completed2024.subtract(completed2023)
//                .divide(completed2023, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        RailwayGoodsSendVO vo2024 = new RailwayGoodsSendVO();
//        vo2024.setYear(2024);
//        vo2024.setRailwayPlannedVolume(new BigDecimal("3570"));
//        vo2024.setRailwayCompletedVolume(completed2024);
//        vo2024.setYoyRate(yoyRate2024);
//        list.add(vo2024);
//
//// 2025年数据
//        BigDecimal completed2025 = new BigDecimal("2629");
//        BigDecimal yoyRate2025 = completed2025.subtract(completed2024)
//                .divide(completed2024, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        RailwayGoodsSendVO vo2025 = new RailwayGoodsSendVO();
//        vo2025.setYear(2025);
//        vo2025.setRailwayPlannedVolume(new BigDecimal("3757"));
//        vo2025.setRailwayCompletedVolume(completed2025);
//        vo2025.setYoyRate(yoyRate2025);
//        list.add(vo2025);



        return ApiResponse.succeed(list);
    }

    @Operation(summary = "路港-铁路货物周转量情况", description = "路港-铁路货物周转量情况")
    @GetMapping(value = "/goodsTurnover")
    public ApiResponse<List<GoodsTurnoverVO>> goodsTurnover(@RequestParam(value = "year", required = false) Integer year) {
        List<GoodsTurnoverVO> list = dryportProdoperTurnoverService.getGoodsTurnoverAnnual(year);

//        List<GoodsTurnoverVO> list = new ArrayList<>();
//
//// 2021年数据（没有同比计算，使用给定的1.06）
//        GoodsTurnoverVO vo2021 = new GoodsTurnoverVO();
//        vo2021.setYear(2021);
//        vo2021.setTurnoverPlanned(new BigDecimal("350"));
//        vo2021.setTurnoverCompleted(new BigDecimal("362"));
//        vo2021.setYoyRate(new BigDecimal("1.06"));
//        list.add(vo2021);
//
//// 2022年数据
//        BigDecimal completed2021 = new BigDecimal("362");
//        BigDecimal completed2022 = new BigDecimal("392");
//        BigDecimal yoyRate2022 = completed2022.subtract(completed2021)
//                .divide(completed2021, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        GoodsTurnoverVO vo2022 = new GoodsTurnoverVO();
//        vo2022.setYear(2022);
//        vo2022.setTurnoverPlanned(new BigDecimal("350"));
//        vo2022.setTurnoverCompleted(completed2022);
//        vo2022.setYoyRate(yoyRate2022);
//        list.add(vo2022);
//
//// 2023年数据
//        BigDecimal completed2023 = new BigDecimal("372");
//        BigDecimal yoyRate2023 = completed2023.subtract(completed2022)
//                .divide(completed2022, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        GoodsTurnoverVO vo2023 = new GoodsTurnoverVO();
//        vo2023.setYear(2023);
//        vo2023.setTurnoverPlanned(new BigDecimal("500"));
//        vo2023.setTurnoverCompleted(completed2023);
//        vo2023.setYoyRate(yoyRate2023);
//        list.add(vo2023);
//
//// 2024年数据
//        BigDecimal completed2024 = new BigDecimal("334");
//        BigDecimal yoyRate2024 = completed2024.subtract(completed2023)
//                .divide(completed2023, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        GoodsTurnoverVO vo2024 = new GoodsTurnoverVO();
//        vo2024.setYear(2024);
//        vo2024.setTurnoverPlanned(new BigDecimal("360"));
//        vo2024.setTurnoverCompleted(completed2024);
//        vo2024.setYoyRate(yoyRate2024);
//        list.add(vo2024);
//
//// 2025年数据
//        BigDecimal completed2025 = new BigDecimal("417");
//        BigDecimal yoyRate2025 = completed2025.subtract(completed2024)
//                .divide(completed2024, 4, BigDecimal.ROUND_HALF_UP)
//                .multiply(new BigDecimal("100"));
//
//        GoodsTurnoverVO vo2025 = new GoodsTurnoverVO();
//        vo2025.setYear(2025);
//        vo2025.setTurnoverPlanned(new BigDecimal("385"));
//        vo2025.setTurnoverCompleted(completed2025);
//        vo2025.setYoyRate(yoyRate2025);
//        list.add(vo2025);
        return ApiResponse.succeed(list);
    }

    @Operation(summary = "路港-港口集港量情况", description = "路港-港口集港量情况")
    @GetMapping(value = "/portGathering")
    public ApiResponse<List<PortGatheringVO>> portGathering(@RequestParam(value = "year", required = false) Integer year) {
         List<PortGatheringVO> list = dryportProdoperPortGatherService.getAnnualPortGathering();





//        List<PortGatheringVO> list = new ArrayList<>();
//
//// 2021年数据（没有同比计算，使用给定的1.06）
//        PortGatheringVO vo2021 = new PortGatheringVO();
//        vo2021.setYear(2021);
//        vo2021.setGatheringPlanned(new BigDecimal("740047"));
//        vo2021.setGatheringCompleted(new BigDecimal("710904"));
//        vo2021.setYoyRate(new BigDecimal("96"));
//        list.add(vo2021);
//
//// 2022年数据
//        BigDecimal completed2021 = new BigDecimal("710904");
//        BigDecimal completed2022 = new BigDecimal("763762");
////        BigDecimal yoyRate2022 = completed2022.subtract(completed2021)
////                .divide(completed2021, 4, BigDecimal.ROUND_HALF_UP)
////                .multiply(new BigDecimal("107"));
//
//        PortGatheringVO vo2022 = new PortGatheringVO();
//        vo2022.setYear(2022);
//        vo2022.setGatheringPlanned(new BigDecimal("764950"));
//        vo2022.setGatheringCompleted(completed2022);
//        vo2022.setYoyRate(vo2022.getGatheringCompleted().divide(vo2022.getGatheringPlanned()));
//        list.add(vo2022);
//
//// 2023年数据
//        BigDecimal completed2023 = new BigDecimal("718623");
////        BigDecimal yoyRate2023 = completed2023.subtract(completed2022)
////                .divide(completed2022, 4, BigDecimal.ROUND_HALF_UP)
////                .multiply(new BigDecimal("100"));
//
//        PortGatheringVO vo2023 = new PortGatheringVO();
//        vo2023.setYear(2023);
//        vo2023.setGatheringPlanned(new BigDecimal("859996"));
//        vo2023.setGatheringCompleted(completed2023);
//        vo2023.setYoyRate(vo2023.getGatheringCompleted().divide(vo2023.getGatheringPlanned()));
//        list.add(vo2023);
//
//// 2024年数据
//        BigDecimal completed2024 = new BigDecimal("671229");
////        BigDecimal yoyRate2024 = completed2024.subtract(completed2023)
////                .divide(completed2023, 4, BigDecimal.ROUND_HALF_UP)
////                .multiply(new BigDecimal("100"));
//
//        PortGatheringVO vo2024 = new PortGatheringVO();
//        vo2024.setYear(2024);
//        vo2024.setGatheringPlanned(new BigDecimal("781394"));
//        vo2024.setGatheringCompleted(completed2024);
//        vo2024.setYoyRate(vo2024.getGatheringCompleted().divide(vo2024.getGatheringPlanned()));
//        list.add(vo2024);
//
//// 2025年数据
//        BigDecimal completed2025 = new BigDecimal("563423");
////        BigDecimal yoyRate2025 = completed2025.subtract(completed2024)
////                .divide(completed2024, 4, BigDecimal.ROUND_HALF_UP)
////                .multiply(new BigDecimal("100"));
//
//        PortGatheringVO vo2025 = new PortGatheringVO();
//        vo2025.setYear(2025);
//        vo2025.setGatheringPlanned(new BigDecimal("800536"));
//        vo2025.setGatheringCompleted(completed2025);
//        vo2025.setYoyRate(vo2025.getGatheringCompleted().divide(vo2025.getGatheringPlanned()));
//        list.add(vo2025);




        // Mock 最近 5 年的数据
//        List<PortGatheringVO> list = new java.util.ArrayList<>();
        return ApiResponse.succeed(list);
    }

    @Operation(summary = "火电-发电计划完成情况", description = "火电-发电计划完成情况")
    @GetMapping(value = "/annualPowerGeneration")
    public ApiResponse<List<AnnualPowerGenerationVO>> annualPowerGeneration(@RequestParam(value = "year", required = false) Integer year) {
        List<AnnualPowerGenerationVO> list = electricProdoperPowerGeneralService.getAnnualPowerGeneration();


//
//        List<AnnualPowerGenerationVO> list = new ArrayList<>();
//
//// 2021年数据
//        AnnualPowerGenerationVO vo2021 = new AnnualPowerGenerationVO();
//        vo2021.setYear(2021);
//        vo2021.setAnnualPlanPower(new BigDecimal("3759357"));
//        vo2021.setAnnualActualPower(new BigDecimal("3835600"));
//        vo2021.setAnnualCompletionRate(new BigDecimal("98"));
//        list.add(vo2021);
//
//// 2022年数据
//        AnnualPowerGenerationVO vo2022 = new AnnualPowerGenerationVO();
//        vo2022.setYear(2022);
//        vo2022.setAnnualPlanPower(new BigDecimal("3795000"));
//        vo2022.setAnnualActualPower(new BigDecimal("3829850"));
//        vo2022.setAnnualCompletionRate(new BigDecimal("100.9"));
//        list.add(vo2022);
//
//// 2023年数据
//        AnnualPowerGenerationVO vo2023 = new AnnualPowerGenerationVO();
//        vo2023.setYear(2023);
//        vo2023.setAnnualPlanPower(new BigDecimal("4109000"));
//        vo2023.setAnnualActualPower(new BigDecimal("3939955"));
//        vo2023.setAnnualCompletionRate(new BigDecimal("95"));
//        list.add(vo2023);
//
//// 2024年数据
//        AnnualPowerGenerationVO vo2024 = new AnnualPowerGenerationVO();
//        vo2024.setYear(2024);
//        vo2024.setAnnualPlanPower(new BigDecimal("4396000"));
//        vo2024.setAnnualActualPower(new BigDecimal("4257447"));
//        vo2024.setAnnualCompletionRate(new BigDecimal("96.8"));
//        list.add(vo2024);
//
//// 2025年数据
//        AnnualPowerGenerationVO vo2025 = new AnnualPowerGenerationVO();
//        vo2025.setYear(2025);
//        vo2025.setAnnualPlanPower(new BigDecimal("4116700"));
//        vo2025.setAnnualActualPower(new BigDecimal("3645818"));
//        vo2025.setAnnualCompletionRate(new BigDecimal("88.5"));
//        list.add(vo2025);

        return ApiResponse.succeed(list);
    }

     @Operation(summary = "火电-供热消耗情况", description = "火电-供热消耗情况")
     @GetMapping(value = "/heatSit")
     public ApiResponse<HeatSitVO> heatConsumption(@RequestParam(value = "year", required = false) Integer year) {

         HeatSitVO vo = new HeatSitVO();
         vo.setWaterCon(BigDecimal.valueOf(1131002));
         vo.setHeatCon(BigDecimal.valueOf(622.56));
         vo.setElectricCon(BigDecimal.valueOf(2669.82));

         return ApiResponse.succeed();
     }

    @Operation(summary = "火电-燃料耗存情况", description = "火电-燃料耗存情况")
    @GetMapping(value = "/fuelConsumption")
    public ApiResponse<List<FuelConsumptionVO>> fuelConsumption(@RequestParam(value = "year", required = false) Integer year) {
        List<FuelConsumptionVO> list = electricProdoperFuelService.getAnnualFuelConsumption();

//
//        List<FuelConsumptionVO> list = new ArrayList<>();
//
//// 2021年数据
//        FuelConsumptionVO vo2021 = new FuelConsumptionVO();
//        vo2021.setYear(2021);
//        vo2021.setCoalConsumption(new BigDecimal("2850"));
//        vo2021.setCoalInCompletion(new BigDecimal("2911"));
//        vo2021.setCoalConsumptionCompletionRate(new BigDecimal("93.5"));
//        list.add(vo2021);
//
//// 2022年数据
//        FuelConsumptionVO vo2022 = new FuelConsumptionVO();
//        vo2022.setYear(2022);
//        vo2022.setCoalConsumption(new BigDecimal("2922"));
//        vo2022.setCoalInCompletion(new BigDecimal("2990"));
//        vo2022.setCoalConsumptionCompletionRate(new BigDecimal("93.8"));
//        list.add(vo2022);
//
//// 2023年数据
//        FuelConsumptionVO vo2023 = new FuelConsumptionVO();
//        vo2023.setYear(2023);
//        vo2023.setCoalConsumption(new BigDecimal("2942"));
//        vo2023.setCoalInCompletion(new BigDecimal("2943"));
//        vo2023.setCoalConsumptionCompletionRate(new BigDecimal("94.5"));
//        list.add(vo2023);
//
//// 2024年数据
//        FuelConsumptionVO vo2024 = new FuelConsumptionVO();
//        vo2024.setYear(2024);
//        vo2024.setCoalConsumption(new BigDecimal("3243"));
//        vo2024.setCoalInCompletion(new BigDecimal("3252"));
//        vo2024.setCoalConsumptionCompletionRate(new BigDecimal("95.6"));
//        list.add(vo2024);
//
//// 2025年数据
//        FuelConsumptionVO vo2025 = new FuelConsumptionVO();
//        vo2025.setYear(2025);
//        vo2025.setCoalConsumption(new BigDecimal("2346"));
//        vo2025.setCoalInCompletion(new BigDecimal("2352"));
//        vo2025.setCoalConsumptionCompletionRate(new BigDecimal("80"));
//        list.add(vo2025);


        return ApiResponse.succeed(list);
    }

    @Operation(summary = "新能源-新能源装机容量", description = "新能源-新能源装机容量")
    @GetMapping(value = "/newEnergyInstallVolume")
    public ApiResponse<List<NewEnergyInstallVolumeVO>> newEnergyInstallVolume(@RequestParam(value = "year", required = false) Integer year) {
        List<NewEnergyInstallVolumeVO> list = wholeNeInstallVolumeService.getNewEnergyInstallVolume(year);
        return ApiResponse.succeed(list);
    }

    @Operation(summary = "新能源-实时功率", description = "新能源-实时功率")
    @GetMapping(value = "/newEnergyRealTimePower")
    public ApiResponse<List<NewEnergyRealTimePowerVO>> newEnergyRealTimePower(@RequestParam(value = "year", required = false) Integer year) {
//        List<NewEnergyRealTimePowerVO> list = wholeNeRealTimePowerService.getNewEnergyRealTimePower(year);


        List<NewEnergyRealTimePowerVO> list = new ArrayList<>();


        return ApiResponse.succeed(list);
    }

    @Operation(summary = "新能源-发电情况", description = "新能源-发电情况")
    @GetMapping(value = "/newEnergyPowerGeneration")
    public ApiResponse<NewEnergyPowerGenerationVO> newEnergyPowerGeneration(@RequestParam(value = "year", required = false) Integer year) {
        NewEnergyPowerGenerationVO vo = wholeNePowerGenerationService.getNewEnergyPowerGeneration(year);
        return ApiResponse.succeed(vo);
    }

    @Operation(summary = "铝业-生产完成情况", description = "铝业-生产完成情况")
    @GetMapping(value = "/aluminumProduction")
    public ApiResponse<List<AluminumProductionVO>> aluminumProduction(@RequestParam(value = "year", required = false) Integer year) {
        List<AluminumProductionVO> list = wholeAlProductionService.getAluminumProduction(year);

//
//        List<AluminumProductionVO> list = new ArrayList<>();
//
//// 按年份倒序添加，2025年第一位
//        list.add(new AluminumProductionVO() {{
//            setYear(2025);
//            setActualAmount(new BigDecimal("109.5"));
//            setCompletionRate(new BigDecimal("78"));
//        }});
//
//        list.add(new AluminumProductionVO() {{
//            setYear(2024);
//            setActualAmount(new BigDecimal("131.6"));
//            setCompletionRate(new BigDecimal("94"));
//        }});
//
//        list.add(new AluminumProductionVO() {{
//            setYear(2023);
//            setActualAmount(new BigDecimal("108.7"));
//            setCompletionRate(new BigDecimal("78"));
//        }});
//
//        list.add(new AluminumProductionVO() {{
//            setYear(2022);
//            setActualAmount(new BigDecimal("88.5"));
//            setCompletionRate(new BigDecimal("63"));
//        }});
//
//        list.add(new AluminumProductionVO() {{
//            setYear(2021);
//            setActualAmount(new BigDecimal("87.8"));
//            setCompletionRate(new BigDecimal("63"));
//        }});

        return ApiResponse.succeed(list);
    }

    @Operation(summary = "铝业-销售完成情况", description = "铝业-销售完成情况")
    @GetMapping(value = "/aluminumSales")
    public ApiResponse<List<AluminumSalesVO>> aluminumSales(@RequestParam(value = "year", required = false) Integer year) {
        List<AluminumSalesVO> list = wholeAlSalesService.getAluminumSales(year);

//
//        List<AluminumSalesVO> list = new ArrayList<>();
//
//// 2021年数据
//        AluminumSalesVO vo2021 = new AluminumSalesVO();
//        vo2021.setYear(2021);
//        vo2021.setLiquidAluminumCompletionRate(new BigDecimal("95"));
//        vo2021.setAluminumIngotCompletionRate(new BigDecimal("147.8"));
//        list.add(vo2021);
//
//// 2022年数据
//        AluminumSalesVO vo2022 = new AluminumSalesVO();
//        vo2022.setYear(2022);
//        vo2022.setLiquidAluminumCompletionRate(new BigDecimal("92.5"));
//        vo2022.setAluminumIngotCompletionRate(new BigDecimal("159.6"));
//        list.add(vo2022);
//
//// 2023年数据
//        AluminumSalesVO vo2023 = new AluminumSalesVO();
//        vo2023.setYear(2023);
//        vo2023.setLiquidAluminumCompletionRate(new BigDecimal("86"));
//        vo2023.setAluminumIngotCompletionRate(new BigDecimal("180.2"));
//        list.add(vo2023);
//
//// 2024年数据
//        AluminumSalesVO vo2024 = new AluminumSalesVO();
//        vo2024.setYear(2024);
//        vo2024.setLiquidAluminumCompletionRate(new BigDecimal("97.3"));
//        vo2024.setAluminumIngotCompletionRate(new BigDecimal("195"));
//        list.add(vo2024);
//
//// 2025年数据
//        AluminumSalesVO vo2025 = new AluminumSalesVO();
//        vo2025.setYear(2025);
//        vo2025.setLiquidAluminumCompletionRate(new BigDecimal("81.5"));
//        vo2025.setAluminumIngotCompletionRate(new BigDecimal("120"));
//        list.add(vo2025);

        return ApiResponse.succeed(list);
    }
    
    @Operation(summary = "产业指标-产业顶部指标", description = "产业指标-产业顶部指标")
    @GetMapping(value = "/wholeProductOverview")
    public ApiResponse<WholeProductOverviewVO> wholeProductOverview(@RequestParam(value = "year", required = false) Integer year) {
        WholeProductOverviewVO vo = wholeOverviewItemService.getLatestOverview(year);
        return ApiResponse.succeed(vo);
    }

    @Operation(summary = "铝业-生产效率情况", description = "铝业-生产效率情况")
    @GetMapping(value = "/aluminumProductionEfficiency")
    public ApiResponse<AluminumProductionEfficiencyVO> aluminumProductionEfficiency(@RequestParam(value = "year", required = false) Integer year) {
        AluminumProductionEfficiencyVO vo = wholeNeProdEfficService.getLatestProductionEfficiency(year);

//        AluminumProductionEfficiencyVO vo = new AluminumProductionEfficiencyVO();
//        vo.setAioAvgConsumption(new BigDecimal("1.914"));
//        vo.setFlAvgConsumption(new BigDecimal("0.013"));
//        vo.setCaAvgConsumption(new BigDecimal("0.485"));

        List<AluminumProductionEfficiencyVO> list = new ArrayList<>();
        list.add(vo);

        return ApiResponse.succeed(vo);
    }

}
